package com.xcc.annotation.ioc.config;

import org.springframework.context.annotation.ImportSelector;
import org.springframework.core.type.AnnotationMetadata;

/**
 * 自定义导入组件返回
 */
public class Demo02_MyImportSelector implements ImportSelector {

    /**
     * @param importingClassMetadata 当前标注@Import注解的类的所有注解信息
     */
    @Override
    public String[] selectImports(AnnotationMetadata importingClassMetadata) {
        //不能返回null
        return new String[]{"com.xcc.annotation.ioc.bean.Cat","com.xcc.annotation.ioc.bussines.MyDogService"};
    }
}
